package com.zwb.demo.easyweb.modules.config.controller;

import com.zwb.demo.easyweb.common.entity.response.ResponseResult;
import com.zwb.demo.easyweb.modules.config.service.FormValidateService;
import com.zwb.demo.easyweb.modules.config.vo.FormValidateVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
 * 校验表
 *
 * @author zwb
 * @date 2020-04-26T14:56:54.008456400
*/
@RestController
@Api(value = "校验表接口" ,description = "校验表接口")
public class FormValidateController {

    private final FormValidateService formValidateService;


    @Autowired
    public FormValidateController(FormValidateService formValidateService) {
        this.formValidateService = formValidateService;
    }

    @GetMapping("/config/formValidate")
    @ApiOperation(value = "查询所有校验表")
    public ResponseResult findAll(){
        return formValidateService.findAll();
    }

    @PutMapping("/config/formValidate")
    @ApiOperation(value = "新增或修改校验表")
    public ResponseResult saveOne(@RequestBody FormValidateVO vo){
        return formValidateService.saveOne(vo);
    }

    @DeleteMapping("/config/formValidate/{uuid}")
    @ApiOperation(value = "删除校验表")
    public ResponseResult deleteOne(@PathVariable String uuid){
        return formValidateService.deleteOne(uuid);
    }

}
